/**     
 * @Title: Service.java   
 * @Package me.xxy.mq.service   
 * @Description: TODO
 * @author weiwei 
 * @date 2018年6月1日 下午3:01:27   
 * @version V1.0     
 */
package me.xxy.mq.service;

import me.xxy.mq.client.DemoMessage;
import me.xxy.mq.client.DemoMessageHandler;
import me.xxy.mq.core.Message;
import me.xxy.mq.core.MessageTrunk;
import me.xxy.mq.util.ContextLoader;

/**
 * @ClassName: Service
 * @Description: TODO
 * @author weiwei
 * @date 2018年6月1日 下午3:01:27
 * 
 */
public class Service {

	/**
	 * @Title: main
	 * @Description: TODO
	 * @param args
	 * @throws InterruptedException
	 * @Reutrn void
	 */
	public static void main(String[] args) throws InterruptedException {
		MessageTrunk trunk = ContextLoader.getBean("messageTrunk");
		Message message = null;
		DemoMessage dm = null;
		for (int i = 0; i < 100; i++) {
			dm = new DemoMessage();
			dm.setGoodsRandomName("goodsRandomName_" + i);
			dm.setMobile("mobile_" + i);
			dm.setValue("value_" + i);
			message = new Message();
			message.setContent(dm);
			message.setKey(DemoMessageHandler.DEMO_MESSAGE_KEY);
			message.setTimes(2);
			message.setSeconds(10000);
			trunk.put(message);
			Thread.sleep(3000);
		}
	}
}
